<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ page isELIgnored="false"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>" />
<link rel="stylesheet"
	href="<%=basePath%>TempreturePointShow/WebContent/css/communityCssAll.css" type="text/css" />
<script type="text/javascript" src="<%=basePath%>TempreturePointShow/WebContent/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="<%=basePath%>TempreturePointShow/WebContent/js/XYshow.js"></script>
<%-- <script type="text/javascript" src="<%=basePath%>TempreturePointShow/WebContent/js/XYzuobiao.js"></script> --%>
<script type="text/javascript" src="<%=basePath%>TempreturePointShow/WebContent/js/communityJsAll.js"></script>
<meta charset="UTF-8">
<!-- 页面自动刷新 -->
<meta http-equiv="refresh" content="600">
<title>小区温度点标示图</title>
<!-- 如何标注 用什么图形标注 -->
<%-- <style type="text/css">
<%-- #community{ --%>
<%-- 	background:rgba(0, 0, 0, 0) url("${pageContext.request.contextPath}/temperature/action/temperatureAction!downloadPNG.do") center no-repeat; --%>
<%-- 	margin-left: -8px;  --%>
<%-- 	margin-top: -14px; --%>
<%-- } --%>
<%-- </style> --%>
<script type="text/javascript">
// var commNameJson = eval(rela);
var commNameJson = ${str};
var builDate = ${commtList};
var houseDate = ${houseDateList};

var builDateShow = [];
$(function(){
	$(document).ready(function () {
		$('div').click(function () {
			builDateShow = [];
			for(var i = 0; i < commNameJson.length; i++){
				for(var j = 0; j < builDate.length; j++){
					if ($("#meanTemp"+j).attr('id') == $(this).attr('id')) {
						if(commNameJson[j].community == builDate[i].buildingName){
							showThisTable.style.display = "none";
							$("#meterNo1").html("");
							$("#meterNo2").html("");
							for(var x = 0; x < 8; x++){
								$("#TemperatureDate"+ x).html("");
								$("#TemperatureDateTwo"+ x).html("");
							}
							if(builDate[i] != null){
								if(builDate[i].buildingValue.length != 0){
									$("#meterNo1").html(builDate[i].buildingValue[0].meterNo);
									builDateShow.push(builDate[i].buildingValue[0]);
								}
								if(builDate[i].buildingValue.length > 1){
									showThisTable.style.display = "block";
									$("#meterNo2").html(builDate[i].buildingValue[1].meterNo);
									builDateShow.push(builDate[i].buildingValue[1]);
								}
							}
						}
					} 
				}
				for(var x = 0; x < builDateShow.length; x++){
					if(builDateShow.length != 0 ){
						$("#TemperatureDate0").html(builDateShow[0].supplyTemperature.toFixed(2) + "℃");
						$("#TemperatureDate1").html(builDateShow[0].backTemperature.toFixed(2) + "℃");
						$("#TemperatureDate2").html(builDateShow[0].temperatureDiff.toFixed(2) + "℃");
						$("#TemperatureDate3").html(builDateShow[0].sumFlow.toFixed(2) + "m³");
						$("#TemperatureDate4").html(builDateShow[0].sumHeat.toFixed(2) + "Gj");
						$("#TemperatureDate5").html(builDateShow[0].instantPower.toFixed(2) + "kW");
						$("#TemperatureDate6").html(builDateShow[0].heatPower.toFixed(2) + "kW");
						$("#TemperatureDate7").html(builDateShow[0].instantFlow.toFixed(2) + "m³/h");
					}
					if(builDateShow.length > 1 ){
						$("#TemperatureDateTwo0").html(builDateShow[1].supplyTemperature.toFixed(2) + "℃");
						$("#TemperatureDateTwo1").html(builDateShow[1].backTemperature.toFixed(2) + "℃");
						$("#TemperatureDateTwo2").html(builDateShow[1].temperatureDiff.toFixed(2) + "℃");
						$("#TemperatureDateTwo3").html(builDateShow[1].sumFlow.toFixed(2) + "m³");
						$("#TemperatureDateTwo4").html(builDateShow[1].sumHeat.toFixed(2) + "Gj");
						$("#TemperatureDateTwo5").html(builDateShow[1].instantPower.toFixed(2) + "kW");
						$("#TemperatureDateTwo6").html(builDateShow[1].heatPower.toFixed(2) + "kW");
						$("#TemperatureDateTwo7").html(builDateShow[1].instantFlow.toFixed(2) + "m³/h");
					}
				}
			}
		});
	});
});
// $(function(){
// // 	$("img").click(function(){
// // 		return false;
// // 	});
// 	for(i in document.images)
// 		document.images[i].ondragstart=imgdragstart;
// });
</script>

</head>
<body onmouseMove="getXY(event)" oncontextmenu="return false;" onmousedown="hidetip()" style="width: 955px;">
	<div id="#community" align="center" style="width: 953px; height: 749px;">
<!-- 		<img src="ftp://test:test@192.168.1.230:2121/admin/community.png" style="height: 749px; width: 952px; margin-left: -8px; margin-top: 3px;" id="community" /> -->
<%-- 		<img src="${pageContext.request.contextPath}/temperature/action/temperatureAction!downloadPNG.do" ondragstart="return false;" style="height: 749px; width: 953px; margin-left: -17px; margin-top: 3px;" id="community" /> --%>
		<img src="<%=basePath%>temperature/action/temperatureAction!downloadPNG.do" ondragstart="return false;" style="height: 749px; width: 953px; margin-left: -17px; margin-top: 3px;" id="community" />
		<div id="XY" style="color:#000; margin-top: 25px; margin-left: 13px; font-size: 12px;"></div>
		<div id="thisDiv" class="thisdiv" style="border-style: double;display: none;z-index: 3;">
			<div style="text-align: center; margin-top: -5px;">
				<font>热量表号：</font><font id="meterNo1"></font>
			</div>
			<table border="0" cellspacing="1" cellpadding="3">
				<tr>
					<td style="border: 1px solid #FFFFFF;">供水温度</td>
					<td style="border: 1px solid #FFFFFF;">回水温度</td>
					<td style="border: 1px solid #FFFFFF;">供回水温差</td>
					<td style="border: 1px solid #FFFFFF;">累计流量</td>
				</tr>
				<tr>
					<td id="TemperatureDate0" style="border: 1px solid #FFFFFF;">&nbsp;</td>
					<td id="TemperatureDate1" style="border: 1px solid #FFFFFF;">&nbsp;</td>
					<td id="TemperatureDate2" style="border: 1px solid #FFFFFF;">&nbsp;</td>
					<td id="TemperatureDate3" style="border: 1px solid #FFFFFF;">&nbsp;</td>
				</tr>
				<tr>
					<td style="border: 1px solid #FFFFFF;">累计热量</td>
					<td style="border: 1px solid #FFFFFF;">瞬时功率</td>
					<td style="border: 1px solid #FFFFFF;">热功率</td>
					<td style="border: 1px solid #FFFFFF;">瞬时流量</td>
				</tr>
				<tr>
					<td id="TemperatureDate4" style="border: 1px solid #FFFFFF;">&nbsp;</td>
					<td id="TemperatureDate5" style="border: 1px solid #FFFFFF;">&nbsp;</td>
					<td id="TemperatureDate6" style="border: 1px solid #FFFFFF;">&nbsp;</td>
					<td id="TemperatureDate7" style="border: 1px solid #FFFFFF;">&nbsp;</td>
				</tr>
			</table>
		</div>
		<div id="showThisTable" style="display: none;">
			<div id="thisTable" class="thistable" style="border-style: double;display: none; z-index: 3;">
				<div style="text-align: center; margin-top: -5px;">
					<font>热量表号：</font><font id="meterNo2"></font>
				</div>
				<table border="0" cellspacing="1" cellpadding="3">
					<tr>
						<td style="border: 1px solid #FFFFFF;">供水温度</td>
						<td style="border: 1px solid #FFFFFF;">回水温度</td>
						<td style="border: 1px solid #FFFFFF;">供回水温差</td>
						<td style="border: 1px solid #FFFFFF;">累计流量</td>
					</tr>
					<tr>
						<td id="TemperatureDateTwo0" style="border: 1px solid #FFFFFF;">&nbsp;</td>
						<td id="TemperatureDateTwo1" style="border: 1px solid #FFFFFF;">&nbsp;</td>
						<td id="TemperatureDateTwo2" style="border: 1px solid #FFFFFF;">&nbsp;</td>
						<td id="TemperatureDateTwo3" style="border: 1px solid #FFFFFF;">&nbsp;</td>
					</tr>
					<tr>
						<td style="border: 1px solid #FFFFFF;">累计热量</td>
						<td style="border: 1px solid #FFFFFF;">瞬时功率</td>
						<td style="border: 1px solid #FFFFFF;">热功率</td>
						<td style="border: 1px solid #FFFFFF;">瞬时流量</td>
					</tr>
					<tr>
						<td id="TemperatureDateTwo4" style="border: 1px solid #FFFFFF;">&nbsp;</td>
						<td id="TemperatureDateTwo5" style="border: 1px solid #FFFFFF;">&nbsp;</td>
						<td id="TemperatureDateTwo6" style="border: 1px solid #FFFFFF;">&nbsp;</td>
						<td id="TemperatureDateTwo7" style="border: 1px solid #FFFFFF;">&nbsp;</td>
					</tr>
				</table>
			</div>
		</div>	
	</div>
</body>
</html>